

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;


import org.carrot2.examples.clustering.clusterDocumentsStc;

public class stcClustering extends HttpServlet {
  public void doGet(HttpServletRequest request,
                    HttpServletResponse response)
      throws ServletException, IOException {
	  response.setContentType("text/html");
    PrintWriter out = response.getWriter();    
    out.println();    
   clusterDocumentsStc abc = new clusterDocumentsStc();    
    String on=(request.getParameter("on")==null)?"t":request.getParameter("on");
    String source=(request.getParameter("source")==null)?"all":request.getParameter("source");
    boolean postProcessingCluster=(request.getParameter("cluster")==null)?false:true;
    boolean postProcessingCapCount=(request.getParameter("capcount")==null)?false:true;
    boolean intent=(request.getParameter("intent")==null)?false:true;
    int iL=Integer.parseInt((request.getParameter("intentLimit")==null)?"5":request.getParameter("intentLimit"));//intentLimit
    float pCC=Float.parseFloat((request.getParameter("pcc")==null)?"0.0":request.getParameter("pcc"));//postClusteringCovearge
    
    boolean reMerge=(request.getParameter("rm")==null)?false:true; //reMerge the postSubclusters depending upon the same name...
    boolean galleries=(request.getParameter("gallery")==null)?false:true; //reMerge the postSubclusters depending upon the same name...
    
    System.out.println(intent);    
    try{
    		
    		out.println(abc.clusterDocuments(request.getParameter("query"),Integer.parseInt(request.getParameter("limit")),on,source,postProcessingCluster, postProcessingCapCount,intent,iL,pCC,reMerge,galleries));    }catch(Exception e){
    	
    }    
  }
}
